﻿using System;
using System.Windows.Forms;

namespace Latin_Vocabulary_Indicator
{
    public partial class resDetail : Form
    {
        resultbox _caller;
        public resDetail(resultbox caller)
        {
            InitializeComponent();
            _caller = caller;
            title.Text = _caller.title.Text;
            onlybox_CheckedChanged(null, null);
            foreach (ListViewItem sub in _caller.calledDetail) if (sub.ForeColor != System.Drawing.Color.Lime) return;
            onlybox.Enabled = false;
        }

        private void onlybox_CheckedChanged(object sender, EventArgs e)
        {
            detailList.Items.Clear();
            foreach(ListViewItem sub in _caller.calledDetail)if(!onlybox.Checked||sub.ForeColor!=System.Drawing.Color.Lime)detailList.Items.Add((ListViewItem)sub);
         
        }

        private void back_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void resDetail_FormClosing(object sender, FormClosingEventArgs e)
        {
            _caller.Show();
            _caller.Focus();
        }
    }
}
